home *** CD-ROM | disk | FTP | other *** search
- echo Sample batch file for InCommand
- rem This is an example of using InCommand utilities in a batch file.
-
- IF NOT %1!==! goto OK
- echo Usage: SORTDIR dirname [/BYTIME] [/BYSIZE] [/BYEXTENSION]
- goto END
-
- :OK
- rem Create a subdirectory to temporarily hold the files
- MOVE %1\*.* %1\~TEMP~.~\ /CREATE
- IF ERRORLEVEL 3 goto ERROR
- rem Now move the files back, sorting as specified. /BYNAME is the default.
- MOVE %1\~TEMP~.~\*.* %1 %2
- IF ERRORLEVEL 3 goto ERROR
- ird/nolist %1\~TEMP~.~
- echo %1 sorted.
- goto END
-
- :ERROR
- echo SORTDIR failed. You may have to retrieve files from %1\~TEMP~.~\
-
- :END
-